﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace crip.Models
{
    public class Area
    {
        private bool _isApproved = false;

        [Key]
        public Guid Id { get; set; }
        //区域名
        [Required]
        public string? Name { get; set; }
        //位置
        [Required]
        public string? Place { get; set; }
        //事件区域（不可空）
        [Required]
        public ICollection<Event>Events{ get; set; }
        [Required]
        public string? Description { get; set; }
        [Required]
        //创建时间
        public string CreatedDate { get; set; }
        //负责人Id
        [Required]
        public string? ResponsiblePersonId { get; set; }
        //区域内人员
        public ICollection<CripUser> CripUsers { get; set; } = new List<CripUser>();

        //总人数 不再查询数据库，而是维护改信息 希望有优化作用
        public int Members_Number { get; set;}

        //是否已认证
        public bool IsApproved
        {
            get
            {
                return _isApproved;
            }
            set
            {
                _isApproved = value;
            }
        }
    }
}
